<div class="portlet">
	<form class="portlet-search-body" name="queryForm">
		<input type="text" class="form-control search-item" ng-model="maintenanceId" placeholder="维修单号">
		<div class="search-item">
			<button class="btn btn-icon-only default"><i class="fa fa-chevron-right"></i></button>
			<button class="btn btn-sm query" ng-click="grid.query();"><i class="fa fa-search"></i> 查询</button>
			<button class="btn btn-sm reset" ng-click="grid.reset();"><i class="fa fa-eraser"></i> 重置</button>
		</div>
	</form>
	<div class="portlet-body">
		<table ed-grid="grid"  class="table table-striped table-bordered table-advance table-hover"
			   data-options="url: 'maintenanceApply/mtQuery.do', modelText: '待办列表', form: 'queryForm', modal: 'modal'">
			<thead>
			<tr>
				<th data-options="field: '_index'"></th>
				<th data-options="field: 'taskType | code : task_type'">任务环节</th>
				<th data-options="field: 'maintenanceId'">维修单号</th>
				<th data-options="field: 'owner'">办理人</th>
				<th data-options="field: 'groupName'">工作组</th>
				<th data-options="field: 'startTime'">开始时间</th>
				<th data-options="field: 'limitTime | limitTo : 10'">截止时间</th>
				<th data-options="field: 'endTime'">完成时间</th>
				<th data-options="field: 'comment'">说明</th>
				<th data-options="field: 'status | code : task_status'">状态</th>
				<th>操作</th>
			</tr>
			</thead>
		</table>
	</div>
</div>


<div ed-modal="modal" data-options="title: '任务详情', static: true, width: 720" ng-style="{'height' : viewTask.images.length > 0 ? '560px' : '280px'}">
	<div class="card" ng-style="{'height' : viewTask.images.length > 0 ? '440px' : '150px','border-color': viewTask.status == '2' ? 'green' : '#ddd'}" style="display: inline-block;width : 100%;border: 1px solid #DDDDDD;margin-top: 5px;">
		<div class="card-header" style="padding-left: 5px;">
			<h4>任务 : <span style="color: red">{{viewTask.taskType | code : 'task_type'}}</span></h4>
		</div>
		<form action="#" class="form-horizontal w5c-form">
			<div class="form-body">
				<div class="form-group" style="margin-bottom: 0">
					<label class="col-md-2 control-label" ng-show="viewTask.workGroupId != undefined && viewTask.workGroupId != ''">工作组:</label>
					<div class="col-md-4" style="margin-top: 9px;" ng-show="viewTask.workGroupId != undefined && viewTask.workGroupId != ''">
						<span>{{viewTask.groupName}}</span>
					</div>
					<label class="col-md-2 control-label">办理人:</label>
					<div class="col-md-4" style="margin-top: 9px;">
						<span ng-style="{'color' : work.leaderFlag == '1' ? 'orangered' : 'black'}" style="margin-right: 10px;" ng-repeat="work in viewTask.taskDetails">{{work.empName}}</span>
					</div>
				</div>
				<div class="form-group" style="margin-bottom: 0">
					<label class="col-md-2 control-label">开始时间:</label>
					<div class="col-md-4" style="margin-top: 9px;">
						<span>{{viewTask.startTime}}</span>
					</div>
					<label class="col-md-2 control-label">结束时间:</label>
					<div class="col-md-4" style="margin-top: 9px;">
						<span>{{viewTask.endTime}}</span>
					</div>
				</div>
				<div class="form-group" style="margin-bottom: 0">
					<label class="col-md-2 control-label">状态:</label>
					<div class="col-md-4" style="margin-top: 9px;">
						<span ng-style="{'color' : viewTask.status == '2' ? 'green' : 'orangered'}">{{viewTask.status | code : 'task_status'}}</span>
					</div>
					<label class="col-md-2 control-label">说明:</label>
					<div class="col-md-4" style="margin-top: 9px;">
						<span>{{viewTask.comment}}</span>
					</div>
				</div>
				<div style="height: 320px;margin-top: 20px;" ng-show="viewTask.images.length > 0">
					<div class="form-group">
						<label class="col-md-2 control-label">附件:</label>
						<div class="col-md-10">
							<div class="mix-grid" style="display: block;height: 260px;overflow-y: auto;overflow-x: hidden">
								<div class="mix" style="display: inline-block;opacity: 1;padding-right: 5px;" ng-repeat="img in viewTask.images">
									<div class="mix-inner">
										<img class="img-responsive" ng-src="{{setting.nginxPath + img.path}}" alt="" style="width:150px;height:120px">
										<div class="mix-details" style="height:50%;">
											<a style="left: 33%" class="mix-preview fancybox-button" ng-href="{{setting.nginxPath + img.path}}" data-rel="fancybox-button">
												<i class="fa fa-search"></i>
											</a>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="form-actions" ng-style="{'margin-top' : viewTask.images.length > 0 ? '-20px' : '35px'}">
				<button type="button" class="btn blue" ng-click="grid.cancel();">
					<i class="fa fa-times"></i> 确定
				</button>
			</div>
		</form>
	</div>
</div>

<div ed-modal="completeModal" data-options="title: '办理任务', static: true, width: 720">
	<form action="#" class="card" style="display: inline-block;width : 100%;height: 110px;border: 1px solid #DDDDDD;margin-top: 5px;" ng-style="{'border-color': completeTask.status == '2' ? 'green' : '#ddd'}">
		<div class="card-header" style="padding-left: 5px;">
			<h4>任务 : <span style="color: red">{{completeTask.taskType | code : 'task_type'}}</span></h4>
		</div>
		<div action="#" class="form-horizontal w5c-form">
			<div class="form-body">
				<div class="form-group" style="margin-bottom: 0">
					<label class="col-md-2 control-label" ng-show="!hasOwnerFlag">工作组:</label>
					<div class="col-md-4" style="margin-top: 9px;" ng-show="!hasOwnerFlag">
						<span>{{completeTask.groupName}}</span>
					</div>

					<label class="col-md-2 control-label" ng-show="hasOwnerFlag">办理人:</label>
					<div class="col-md-4" style="margin-top: 9px;" ng-show="hasOwnerFlag">
						<span>{{completeTask.empName}}</span>
					</div>

					<label class="col-md-2 control-label">开始时间:</label>
					<div class="col-md-4" style="margin-top: 9px;">
						<span>{{completeTask.startTime}}</span>
					</div>
				</div>
				<div class="form-group" style="margin-bottom: 0">
					<label class="col-md-2 control-label">截止时间:</label>
					<div class="col-md-4" style="margin-top: 9px;">
						<span>{{completeTask.limitTime | limitTo : '10'}}</span>
					</div>
					<label class="col-md-2 control-label">状态:</label>
					<div class="col-md-4" style="margin-top: 9px;">
						<span ng-style="{'color' : completeTask.status == '2' ? 'green' : 'orangered'}">{{completeTask.status | code : 'task_status'}}</span>
					</div>
				</div>
			</div>
		</div>
		<div class="form-actions" style="position: absolute;left: 76%;bottom: 6%">
			<button type="button" class="btn default" ng-click="cancelCompleteTaskModal();">
				<i class="fa fa-times"></i> 取消
			</button>
			<button type="button" class="btn blue" ng-click="completeModalObj.ok();">
				<i class="fa fa-times"></i> 确定
			</button>
		</div>
	</form>

	<div class="card">
		<div class="card-header" style="padding-left: 5px;">
			<h4>办理</h4>
		</div>
		<div class="form-horizontal w5c-form">
			<div class="form-body">
				<div class="form-group" style="margin-bottom: 0" ng-show="!hasOwnerFlag">
					<label class="col-md-2 control-label">办理人:</label>
					<div class="col-md-4" style="margin-top: 9px;">
						<span ng-repeat="emp in completeTask.empList" style="margin-right: 5px;" ng-style="{'color' : emp.leaderFlag == '1' ? 'orangered' : 'black'}">
							<input type="checkbox" name="empCheck" ng-click="selectEmp(emp,$event)"> {{emp.empName}}
						</span>
					</div>
				</div>
				<div class="form-group" style="margin-bottom: 0">
					<label class="col-md-2 control-label">说明:</label>
					<div class="col-md-10" style="margin-top: 9px;">
						<textarea class="form-control" name="comment" ng-model="completeTask.comment">
						</textarea>
					</div>
				</div>
				<div class="form-group" style="margin-bottom: 10px" ng-show="!hasOwnerFlag">
					<label class="col-md-2 control-label">修补画师:</label>
					<div class="col-md-5" style="margin-top: 9px;">
						<div ed-combotree name="member" placeholder="修补画师"
							 data-options="idField: 'id', textField: 'name', parentIdField: 'parentId'"
							 ng-model="completeTask.id" ed-selectable="selectable(data)" ed-data="empList"></div>
					</div>
				</div>
				<div class="form-group" ng-show="!hasOwnerFlag">
					<label class="col-md-2 control-label">附件:</label>
					<div class="col-md-10" style="margin-bottom: 20px;">
						<div ed-uploader data-options="text:' 上传附件',multiple: true,maxLength:8,accept:'image/*'" class="ng-uploader" ng-model="completeTask.images"></div>
						<div class="mix-grid" style="display: block;margin-bottom: 20px;">
							<div class="mix" style="display: inline-block;opacity: 1;padding-right: 5px;" ng-repeat="img in completeTask.images">
								<div class="mix-inner">
									<img class="img-responsive" ng-src="{{setting.nginxPath + img.path}}" alt="" style="width:150px;height:120px">
									<div class="mix-details" style="height:50%;">
										<a class="mix-link" ng-click="removeImg(img);">
											<i class="fa fa-close" ></i>
										</a>
										<a class="mix-preview fancybox-button" ng-href="{{setting.nginxPath + img.path}}" data-rel="fancybox-button">
											<i class="fa fa-search"></i>
										</a>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
